package android.tong;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RadioButton;

public class DrawViewDemo extends Activity implements OnClickListener {

	private final int WC = ViewGroup.LayoutParams.WRAP_CONTENT;
	DrawView dv;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		LinearLayout layout = new LinearLayout(this);
		layout.setOrientation(LinearLayout.HORIZONTAL);
		LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(150, 300);
		param.leftMargin = 1;
		dv = new DrawView(this);
		layout.addView(dv, param);
		
		RadioButton ra;
		ra = new RadioButton(this);
		param = new LinearLayout.LayoutParams(WC, WC);
		param.topMargin = 40;
		layout.addView(ra, param);
		
		ra.setOnClickListener(this);
		setContentView(layout);
	}
	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		dv.invalidate();
	}

	
}
